<!--#include file="Config.asp" -->
<!--#include file="HeadTop.asp"-->

<%

intID=int(Request("id"))
ActionType=request("ActionType")
SaveType=request("SaveType")
set rs=server.createobject("adodb.recordset")

'Add
if ActionType="Add" or ActionType="" then
AName="确定增加"
URL="?SaveType=AddOK"
end if

'Mod
if ActionType="Mod" and intID<>"" then
AName="确定修改"
sql="select * from Plan_URLLogType where ID="&Intid
rs.open sql,conn,1,1
title=trim(rs("title"))
IntID=int(rs("ID"))
rs.close
AID=intID
URL="?SaveType=ModOK&ID="&intID
end if

'SaveAdd
if SaveType="AddOK" and request("title")<>"" then
sql="select * from Plan_URLLogType where ID is null"
rs.open sql,conn,1,3
rs.addnew
rs("title")=trim(Request("title"))
rs.Update
rs.close
end if

'SaveMod
if SaveType="ModOK" and intID<>"" and request("title")<>"" then
sql="select * from Plan_URLLogType where ID="&IntID
rs.open sql,conn,1,3
rs("title")=trim(Request("title"))
rs.Update
title=trim(rs("title"))

AID=intID
URL="?SaveType=ModOK&ID="&intID
AName="确定修改"
rs.close

end if
%>
<!--添加  -->
<TABLE class="table table-condensed">
<form method="post" action="" name="form1">
<tr>
<td>
<input type="text" name="title" value="<%=title%>">
<input type="submit" name="Submit" value="<%=aname%>">
<A HREF="?ActionType=Add">[<U><FONT COLOR="#FF0000"><B>增加</B></FONT></U>]</A>

</td>
</tr>
</form>
</table>

<%
sql="select * from Plan_URLLogType order by ID"
rs.open sql,conn,1,1
%>
<TABLE class="table table-condensed">
<tr bgcolor='#ddeeff'>
	<td>ID</td>
	<td>Admin</td>
	<td>Title</td>
</tr>
<%
for r=1 to rs.recordcount
%>
<tr >
<td><%=rs("ID")%></td>
<TD><A HREF="?ActionType=Mod&ID=<%=rs("ID")%>" >修改</A></td>
<TD><%=rs("title")%></td>
</tr>
<%
rs.moveNext
next
rs.close
%>
</TABLE>
<!-- #include file="foot.asp" -->